<template>
  <div class='work-menu first-box'>
    <img :src="logo" alt="">
    <SecondMenu class="big-img" :listData="listData.info1.data" :title="listData.info1.title"></SecondMenu>
    <GreyLine></GreyLine>
    <SecondMenu :listData="listData.info2.data" :title="listData.info2.title"></SecondMenu>
    <!-- <iframe src="http://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=jT1Dze2OBzWaGbR9z9SfHHRH&client_secret=sqGKKjft4Rpzs5cwFYlhGWfCqgRKqt24" frameborder="0"></iframe> -->
  </div>
</template>
<script>
import SecondMenu from './common/secondmenu'
import GreyLine from '../common/line.vue'
export default {
  components: {SecondMenu,GreyLine},
  name: "",
  data() {
    return {
      logo:require("../../assets/img/car.jpg"),

      listData:{
        info1:{
          title:"统计分析",
          data:[
            {
              label:"报表管理",
              img:require('../../assets/img/works/1.png'),
              url:"",
            },{
              label:"销售排名",
              img:require('../../assets/img/works/2.png'),
              url:"/works/salerank",
            },{
              label:"我的消息",
              img:require('../../assets/img/works/3.png'),
              url:"/works/news",
            }
          ]
        },
        info2:{
          title:"工作台",
          data:[
            {
              label:"接车服务",
              img:require('../../assets/img/works/4.png'),
              url:"/works/cars",
            },{
              label:"卡券派发",
              img:require('../../assets/img/works/5.png'),
              url:"/works/card",
            },{
              label:"活动列表",
              img:require('../../assets/img/works/6.png'),
              url:"/works/activities",
            },{
              label:"售后预约",
              img:require('../../assets/img/works/7.png'),
              url:"/works/aftersale",
            },{
              label:"我的客户",
              img:require('../../assets/img/works/8.png'),
              url:"/works/customer",
            }
          ]
        }
      }
    };
  },
  methods: {

    // 获取百度的车牌识别access_token
    getAccess(){
      // http://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=jT1Dze2OBzWaGbR9z9SfHHRH&client_secret=sqGKKjft4Rpzs5cwFYlhGWfCqgRKqt24
      // var iframe=document.createElement("iframe")
      // iframe.src="http://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=jT1Dze2OBzWaGbR9z9SfHHRH&client_secret=sqGKKjft4Rpzs5cwFYlhGWfCqgRKqt24"
      // iframe.name="iframeName"
      // // iframe.onload = function () {
      // //   console.log(iframe.contentWindow.document);
      // // };

      // this.$nextTick(()=>{
      //   document.querySelector(".work-menu").appendChild(iframe)
      // })

      // $.post("http://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=jT1Dze2OBzWaGbR9z9SfHHRH&client_secret=sqGKKjft4Rpzs5cwFYlhGWfCqgRKqt24")
      
    }
  },
  created() {
    
    this.getAccess()
  }
};
</script>
<style lang="scss" scoped>
.work-menu {

  >img{
    width: 100%;
    height: 120px;
  }
}
</style>